<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
 <head>
  <meta http-equiv="content-type" content="text/html; charset=UTF-8">
  <title>设置一个语句属性</title>

 </head>
 <body><div class="manualnavbar" style="text-align: center;">
 <div class="prev" style="text-align: left; float: left;"><a href="pdostatement.rowcount.html">PDOStatement::rowCount</a></div>
 <div class="next" style="text-align: right; float: right;"><a href="pdostatement.setfetchmode.html">PDOStatement::setFetchMode</a></div>
 <div class="up"><a href="class.pdostatement.html">PDOStatement</a></div>
 <div class="home"><a href="index.html">PHP Manual</a></div>
</div><hr /><div id="pdostatement.setattribute" class="refentry">
 <div class="refnamediv">
  <h1 class="refname">PDOStatement::setAttribute</h1>
  <p class="verinfo">(PHP 5 &gt;= 5.1.0, PECL pdo &gt;= 0.2.0)</p><p class="refpurpose"><span class="refname">PDOStatement::setAttribute</span> &mdash; <span class="dc-title">
   设置一个语句属性
  </span></p>

 </div>
 <div class="refsect1 description" id="refsect1-pdostatement.setattribute-description">
  <h3 class="title">说明</h3>
  <div class="methodsynopsis dc-description">
   <span class="type">bool</span> <span class="methodname"><strong>PDOStatement::setAttribute</strong></span>
    ( <span class="methodparam"><span class="type">int</span> <code class="parameter">$attribute</code></span>
   , <span class="methodparam"><span class="type"><a href="language.pseudo-types.html#language.types.mixed" class="type mixed">mixed</a></span> <code class="parameter">$value</code></span>
   )</div>


  <p class="para rdfs-comment">
   给语句设置一个属性。当前，没有通用的属性可以设置，只有驱动特定的属性：
   <ul class="itemizedlist">
    <li class="listitem"><p class="para"><em>PDO::ATTR_CURSOR_NAME</em>
    （Firebird 和 ODBC 特性）：
     为 <em>UPDATE ... WHERE CURRENT OF</em> 设置游标名称。
    </p></li>
   </ul>
  </p>

 </div>


 <div class="refsect1 returnvalues" id="refsect1-pdostatement.setattribute-returnvalues">
  <h3 class="title">返回值</h3>
  <p class="para">
   成功时返回 <strong><code>TRUE</code></strong>， 或者在失败时返回 <strong><code>FALSE</code></strong>。
  </p>
 </div>


 <div class="refsect1 seealso" id="refsect1-pdostatement.setattribute-seealso">
  <h3 class="title">参见</h3>
  <p class="para">
   <ul class="simplelist">
    <li class="member"><span class="function"><a href="pdo.getattribute.html" class="function" rel="rdfs-seeAlso">PDO::getAttribute()</a> - 取回一个数据库连接的属性</span></li>
    <li class="member"><span class="function"><a href="pdo.setattribute.html" class="function" rel="rdfs-seeAlso">PDO::setAttribute()</a> - 设置属性</span></li>
    <li class="member"><span class="function"><a href="pdostatement.getattribute.html" class="function" rel="rdfs-seeAlso">PDOStatement::getAttribute()</a> - 检索一个语句属性</span></li>
   </ul>
  </p>
 </div>


</div><hr /><div class="manualnavbar" style="text-align: center;">
 <div class="prev" style="text-align: left; float: left;"><a href="pdostatement.rowcount.html">PDOStatement::rowCount</a></div>
 <div class="next" style="text-align: right; float: right;"><a href="pdostatement.setfetchmode.html">PDOStatement::setFetchMode</a></div>
 <div class="up"><a href="class.pdostatement.html">PDOStatement</a></div>
 <div class="home"><a href="index.html">PHP Manual</a></div>
</div></body></html>
